package com.ucn.groupawesome.archgame;

import java.util.ArrayList;

public class Category
{
	int color;
	String name;
	ArrayList<Brick> listBricks;
	int fontColor;

	public Category(String name, int color, int fontColor)
	{
		super();

		this.name = name;
		this.color = color;
		this.fontColor = fontColor;
		this.listBricks = new ArrayList<Brick>();
	}

	public String getName()
	{
		return name;
	}

	public void setName(String name)
	{
		this.name = name;
	}

	public int getFontColor()
	{
		return fontColor;
	}

	public void setFontColor(int fontColor)
	{
		this.fontColor = fontColor;
	}

	public ArrayList<Brick> getListBricks()
	{
		return listBricks;
	}

	public ArrayList<String> getListBricksName()
	{
		ArrayList<String> list = new ArrayList<String>();

		for (Brick b : listBricks)
		{
			list.add(b.getName());
		}

		return list;
	}

	public void setListBricks(ArrayList<Brick> listBricks)
	{
		this.listBricks = listBricks;
	}

	public int getColor()
	{
		return color;
	}

	public void setColor(int color)
	{
		this.color = color;
	}

	public boolean getBrickFromList(String name)
	{
		for (Brick b : listBricks)
		{
			if (b.getName().equals(name))
			{
				return true;
			}
		}

		return false;
	}

	public void addBrick(Brick brick)
	{
		if (!getBrickFromList(brick.getName()))
		{
			listBricks.add(brick);
		}
	}

	public void removeBrick(Brick brick)
	{
		listBricks.remove(brick);
	}
}
